package com.newlink.building.userinfo.activity

import android.content.Intent
import android.view.View
import android.widget.TextView
import com.newlink.building.common_base.base.NL_BaseMvpActivity
import com.newlink.building.userinfo.R
import com.newlink.building.userinfo.databinding.ActivityCallSettingBinding
import com.newlink.building.userinfo.mvp.Module_UserInfo_CallSettingPresenter
import com.newlink.building.userinfo.mvp.contract.Module_UserInfo_CallSettingContract
import com.newlink.building.obfuscation.Module_Obfuscation_ObfuscationHelper
import com.newlink.building.obfuscation.Module_Obfuscation_ObfuscationInvoker

/**
 * @author wangyang
 * @date 2022/9/19
 * @description 我的-通话设置页面
 */
class Module_UserInfo_CallSettingActivityNL :
    NL_BaseMvpActivity<Module_UserInfo_CallSettingContract.View, Module_UserInfo_CallSettingContract.Presenter>(),
    Module_UserInfo_CallSettingContract.View, View.OnClickListener {

//    override fun attachLayoutRes(): Int {
//        return R.layout.activity_call_setting
//    }

    private lateinit var mBinding: ActivityCallSettingBinding
    override fun attachLayoutRes(): View {
        mBinding = ActivityCallSettingBinding.inflate(layoutInflater)
        return mBinding.root
    }

    override fun initData() {
    }

    override fun initView() {
        // 通话设置页面初始化时的混淆
        Module_Obfuscation_ObfuscationHelper.onMethodEnter("CallSettingActivity", "initView")
        Module_Obfuscation_ObfuscationInvoker.invokeRandom("call_setting")

        findViewById<TextView>(R.id.tv_title_bar_center).text =
            resources.getText(R.string.call_setting)
        mBinding.clCallPreference.setOnClickListener(this)
    }

    override fun onClick(v: View?) {
        // 点击事件处理前的混淆
        Module_Obfuscation_ObfuscationInvoker.invokeSpecific(9, v?.id)

        when (v?.id) {
            R.id.cl_call_preference -> {
                //呼叫偏好
                startActivity(Intent(this, Module_UserInfo_CallSettingCallPreferenceActivityNL::class.java))
            }
        }
    }

    override fun createPresenter(): Module_UserInfo_CallSettingContract.Presenter {
        return Module_UserInfo_CallSettingPresenter()
    }

    override fun showData() {
    }
}